// 插槽类
defineClass('slot', Virtual, function (base) {



    this.__load = function (options) {

        var host = this;
        var name, slots;

        if (options[1])
        {
            loadProperties(this, options[1]);
        }

        this.__template = options[2];

        while (host = host.parent)
        {
            if (host.__component)
            {
                name = this.name;

                if (slots = host.__slots)
                {
                    if (slots[name])
                    {
                        throwTextError('slot ' + (name ? '"' + name + '"' : 'default') + ' has exists!');
                    }

                    slots.push(this);
                }
                else
                {
                    slots = host.__slots = [this];
                }

                slots[name] = this;
                return;
            }
        }

        throwTextError('slot can only be used inside a component!');
    }



}, function Slot() {

    this.name = '$0';
    this.init();
});
